import java.util.Scanner;
 		
 		public class Anagram 
          {
 		    public static void main(String args[]) 
                     {
 		         System.out.println("Write first phrase");
 		                Scanner in = new Scanner(System.in);
 		        char [] firstphrase = in.nextLine().toLowerCase().replaceAll("[ \t]", "").toCharArray();
 		                System.out.println("Write second phrase");
 		        char [] secondphrase = in.nextLine().toLowerCase().replaceAll("[ \t]", "").toCharArray();
 		       
 		            if (Anagramtrue(firstphrase, secondphrase)) 
                                 {
 		                 System.out.println("True, it's an anagram.");
 		                 } 
                              else 
                                 {
 	                         System.out.println("False, it isn't an anagram");
 	                         }
 	                 in.close();
 		     }
 		
 		 private static boolean Anagramtrue(char[] firstphrase, char[] secondphrase) 
                  {
	               if (firstphrase.length != secondphrase.length) 
                                 {
 		                 return false;
 		                 }
 		           for (int i = 0; i < firstphrase.length; i++) 
                              {
 		                 boolean issamechar = false;
 		
 		               for (int j = i; j < secondphrase.length; j++) 
                                   {
 		                   if (firstphrase[i] == secondphrase[j]) 
                                         {
 		                         char buffer = secondphrase[j];
 		                         secondphrase[j] = secondphrase[i];
 		                         secondphrase[i] = buffer;
 		                         issamechar = true;
 	                                 break;
 		                         }
 		                    }
 		                   if (!issamechar) 
                                    {
 		                    return false;
 	                            }
 	                       }
 	         return true;
 		   }
            }
